class Solution45 {
    public int jump(int[] nums) {
        if(nums.length <= 1) return 0 ;
        int n = nums.length ; 
        int left = 0 ; 
        int right = 0 ;
        int count = 0 ;
        int  max = nums[0];
        while(right < n-1){
           right = max ; 
           while(left < n && left <= right){
               if(nums[left] + left > max){
                max = nums[left] + left ;  
               }
               left ++ ;
           }
           count ++; 
        }
        return count ; 
    }
}